package com.ruoyi.sale.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.sale.domain.SysCustomer;
import com.ruoyi.sale.mapper.SysCustomerMapper;
import com.ruoyi.sale.service.ISysCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 顾客管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-23
 */
@Service
public class SysCustomerServiceImpl implements ISysCustomerService 
{
    @Autowired
    private SysCustomerMapper sysCustomerMapper;

    /**
     * 查询顾客管理
     * 
     * @param id 顾客管理主键
     * @return 顾客管理
     */
    @Override
    public SysCustomer selectSysCustomerById(Long id)
    {
        return sysCustomerMapper.selectSysCustomerById(id);
    }

    /**
     * 查询顾客管理列表
     * 
     * @param sysCustomer 顾客管理
     * @return 顾客管理
     */
    @Override
    public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer)
    {
        return sysCustomerMapper.selectSysCustomerList(sysCustomer);
    }

    /**
     * 新增顾客管理
     * 
     * @param sysCustomer 顾客管理
     * @return 结果
     */
    @Override
    public int insertSysCustomer(SysCustomer sysCustomer)
    {
        sysCustomer.setCreateTime(DateUtils.getNowDate());
        return sysCustomerMapper.insertSysCustomer(sysCustomer);
    }

    /**
     * 修改顾客管理
     * 
     * @param sysCustomer 顾客管理
     * @return 结果
     */
    @Override
    public int updateSysCustomer(SysCustomer sysCustomer)
    {
        sysCustomer.setUpdateTime(DateUtils.getNowDate());
        return sysCustomerMapper.updateSysCustomer(sysCustomer);
    }

    /**
     * 批量删除顾客管理
     * 
     * @param ids 需要删除的顾客管理主键
     * @return 结果
     */
    @Override
    public int deleteSysCustomerByIds(Long[] ids)
    {
        return sysCustomerMapper.deleteSysCustomerByIds(ids);
    }

    /**
     * 删除顾客管理信息
     * 
     * @param id 顾客管理主键
     * @return 结果
     */
    @Override
    public int deleteSysCustomerById(Long id)
    {
        return sysCustomerMapper.deleteSysCustomerById(id);
    }
}
